package com.qut.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.qut.service.controller_list_Service;

/**
 * Servlet implementation class change_item_Servlet
 */
@WebServlet("/find_item_Servlet")
public class find_item_Servlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public find_item_Servlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String item_id=request.getParameter("item_id");
		String item_status=request.getParameter("item_status");
		String item_intime=request.getParameter("item_intime");
		String item_outtime=request.getParameter("item_outtime");
		String flyman_id=request.getParameter("flyman_id");
		controller_list_Service controller_list_Service=new controller_list_Service();
		List<Map<String, Object>> list=controller_list_Service.find(item_id,item_status, item_intime, item_outtime, flyman_id);
		HttpSession session=request.getSession();
		session.setAttribute("search_item", list);
		response.sendRedirect("controller_search.jsp");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
